package com.clw.template.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

import java.io.Serializable;

public enum MenuEnum implements IEnum {
    DIRECTORY(0,"目录"),MENU(1,"菜单"),BUTTON(2,"按钮"),OTHER(3,"其它");
    @EnumValue//标记数据库存的值是code
    private int code;
    private String name;

    MenuEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    @JsonValue
    public String getName() {
        return name;
    }

    @Override
    public Serializable getValue() {
        return this.code;
    }
}
